<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-touch-fullscreen" content="yes" />
		<meta name="format-detection" content="telephone=no"/>
		<meta name="apple-mobile-web-app-status-bar-style" content="black" /> 
		<meta name="msapplication-tap-highlight" content="no" />
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, width=device-width, viewport-fit=cover" />
		<title>启蒙优选-钱包</title>
		<link rel="stylesheet" href="__TMPL__/home/public/assets/css/style.css?v=072401" />
	</head>
	<style>
		.walletTop{position: relative;}
		.moneyDetail{position: absolute;right:.5rem;top:.4rem;font-size:.5rem;color:#fff;z-index: 99;display: block;width:3rem;text-align: right}
	</style>
	<body>
		<!-- 提现 --> 
		<div class="walletIndex">
			<div class="content">
				<div class="walletTop flex flexdirection juscenter alitemCenter">
					<p>可提现金额</p>
					<a class="moneyDetail" href="./tx_list">明细</a>
					<h3>￥{$meminfo.money}</h3>
					<span>即将到账￥{$count_money}</span>
				</div>
				<div class="walletContent">
					<h4>提现金额</h4>
					<div class="inputText">
						<b>￥</b><input class="withdrawal_money" type="number">
					</div>
					<div class="walletAll">全部提现</div>
					<h4>提现方式</h4>
					<div class="modeList flex alitemCenter">
						<div class="item flex juscenter">
							<img src="__TMPL__/home/public/assets/img/wechat_1.png" alt="">
							<span>微信</span>
						</div>
					</div>
					<h4>注意事项</h4>
					<div class="careful">
						<p>1、提现不收手续费</p>
						<p>2、提现单笔金额不能小于5元</p>
					</div>
					<div class="textCenter">
						<button id="goBuyNow">立即提现</button>
					</div>
				</div>
			</div>
		</div>
	</body>
	<script rel="stylesheet" src="__TMPL__/home/public/assets/js/jquery-2.0.3.min.js"></script>
  	<script rel="stylesheet" src="__TMPL__/home/public/assets/js/layer/layer.js"></script>
  	<script rel="stylesheet" src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
  	<script rel="stylesheet" src="__TMPL__/home/public/assets/js/base.js"></script>
	<script>
		$(function(){
			$('.walletAll').click(function(){
				$('.withdrawal_money').val({$meminfo.money});
			})
			//点击支付
		    $('#goBuyNow').click(function(){
		    	var withdrawal_money = $('.withdrawal_money').val()||0;
		    	if(Number(withdrawal_money)<=0){
		    		return layer.msg('请输入提现金额！')
		    	}
		        $.ajax({
		          url: '/member_tx',
		          type: 'POST',
		          data: {withdrawal_money:withdrawal_money},
		        }).done(function(res) {
		          if(res.code == 200){
		            var data = res.data;
			      	location.href="./tx_success?id="+data.id;
		          }else{
			      	return layer.msg(res.msg);
		          }
		        }).fail(function(err) {
		          layer.msg(err.msg);
		        })
		    })
		})
	</script>
</html>
